package com.learn.design.strategy.example;

import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * @author Administrator
 */

@Component
public class FormPreviewSubmitHandler implements FormSubmitHandler<Serializable> {

    @Override
    public String getSubmitType() {
        return "preview";
    }

    @Override
    public CommonPairResponse<String, Serializable> handleSubmit(FormSubmitRequest request) {
        System.out.printf("预览模式提交：userId=%s, formInput=%s%n", request.getUserId(), request.getFormInput());

        return CommonPairResponse.success("预览模式提交数据成功！", null);
    }
}